//
//  Recorder.h
//  CocoaRecorder
//
//  Created by Mathieu Tozer on 12/10/06 (quite late at night).
//  Copyright 2006 __MyCompanyName__. All rights reserved.
//
// And here's your neat little Cocoa object. Recorder. 
// Instantiate one in your own nib and connect the dots.

#import <Cocoa/Cocoa.h>
#import "DCAudioFileRecorder.mm"

@class WordArrayController;
@class WordMO;
@class DefinitionMO;

AudioStreamBasicDescription	gAACFormat = {44100.0, kAudioFormatMPEG4AAC, kAudioFormatFlagIsBigEndian, 0, 1024, 0, 2, 0, 0};


@interface Recorder : NSObject {
	WordMO *currentWord;
	DefinitionMO *currentDef;
	NSString *currentWordFullPath;
	NSString *currentDefFullPath;
	
	IBOutlet NSButton *deleteRecordingButton; //either visible or not visible.
	IBOutlet NSButton *recordStopRecordButton;
	IBOutlet NSButton *playStopPlayingButton;
	
	IBOutlet WordArrayController *wordArrayController;  //for getting the current selection that will be recorded.
	IBOutlet NSArrayController *definitionArrryController;
	
	bool					gIsRecording;
	DCAudioFileRecorder		*gAudioFileRecorder;
	FSRef					gParentDir; 
	CFStringRef				gFileName;
	NSString				*location;
	NSString				*fileName;
}

-(IBAction)startStopRecording:(id)sender; 
-(IBAction)startStopPlayback:(id)sender;

-(IBAction)startStopRecordingDefinition:(id)sender;
-(IBAction)startStopPlaybackDefinition:(id)sender;
-(IBAction)deleteDefinitonRecording:(id)sender;


-(void)startRecording;
-(void)stopRecording;
-(void)startPlayback;
-(void)stopPlayback;

-(IBAction)deleteRecording:(id)sender;

- (id)init; 

- (OSStatus)StartRecording;
- (OSStatus)StopRecording;

- (NSString *)location;
- (void)setLocation:(NSString *)value;

- (NSString *)fileName;
- (void)setFileName:(NSString *)value;


@end


